package com.ctgu.enums;

public enum  AccountEnum {

	ADMIN(3, "Admin"),
	TEACHER(2, "Teacher"),
	ASSISTANT(1, "Assistant"),
	STUDENT(0, "Student"),

			;

	Integer level;
	String name;

	AccountEnum(Integer level, String name) {
		this.level = level;
		this.name = name;
	}

	public Integer getLevel() {
		return level;
	}

	public String getName() {
		return name;
	}
	public static AccountEnum getAccountEnum(Integer level){
		for(AccountEnum accountEnum:AccountEnum.values()){
			if(accountEnum.level.equals(level)){
				return accountEnum;
			}
		}
		return null;
	}
}
